# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo8.05
# Description:
# Author:       $赵怡蕾
# Date:         2019/3/4
#-------------------------------------------------------------------------------

class MyParentClass:
    def method(self):
        return 50
class ParentClass(MyParentClass):
    def method1(self):
        print("method1")
class MyClass:
    def method(self):
        return 40
class ChildClass(ParentClass):
    def method2(self):
        print("method2")
# 运行结果：True
print(issubclass(ChildClass,ParentClass))
# 运行结果：False
print(issubclass(ChildClass,MyClass))
# 运行结果：True
print(issubclass(ChildClass,MyParentClass))
# 运行结果：(<class '__main__.ParentClass'>,)
print(ChildClass.__bases__)
# 运行结果：(<class '__main__.MyParentClass'>,)
print(ParentClass.__bases__)

child = ChildClass()
# 运行结果：True
print(issubclass(child, ChildClass))
# 运行结果：True
print(issubclass(child, ParentClass))
# 运行结果：True
print(issubclass(child, MyParentClass))
# 运行结果：False
print(issubclass(child, MyClass))